import type { R, TableDataInfo } from '@/api/model/resultModel';
import type { XhljEnterpriseForm, XhljEnterpriseQuery, XhljEnterpriseVo } from '@/api/xhlj/model/enterpriseModel';
import { request } from '@/utils/request';

// 查询企业展商列表
export function listEnterprise(query?: XhljEnterpriseQuery) {
  return request.get<TableDataInfo<XhljEnterpriseVo>>({
    url: '/xhlj/enterprise/list',
    params: query,
  });
}

// 查询企业展商详细
export function getEnterprise(enterpriseId: number) {
  return request.get<R<XhljEnterpriseVo>>({
    url: `/xhlj/enterprise/${enterpriseId}`,
  });
}

// 新增企业展商
export function addEnterprise(data: XhljEnterpriseForm) {
  return request.post<R<void>>({
    url: '/xhlj/enterprise',
    data,
  });
}

// 修改企业展商
export function updateEnterprise(data: XhljEnterpriseForm) {
  return request.put<R<void>>({
    url: '/xhlj/enterprise',
    data,
  });
}

// 删除企业展商
export function delEnterprise(enterpriseIds: number | Array<number>) {
  return request.delete<R<void>>({
    url: `/xhlj/enterprise/${enterpriseIds}`,
  });
}
